Fox's Git Mirrors
Commit 9e0fb0258103d1bab3e0e4cf812db1506928bbb6
Parents : 5443d30
Author : attermann <attermann@gmail.com>
Date : 2023-12-02T09:38:24-07:00
WIP: UDPInterface
Changes
2 files changed, 5 insertions(+), 3 deletions(-)
Diff
diff --git a/src/Interfaces/UDPInterface.cpp b/src/Interfaces/UDPInterface.cpp
index 289eaa1..5adcf50 100644
--- a/src/Interfaces/UDPInterface.cpp
+++ b/src/Interfaces/UDPInterface.cpp
@@ -43,7 +43,7 @@ UDPInterface::UDPInterface(const char* name /*= "UDPInterface"*/) : Interface(na
stop();
}
-bool UDPInterface::start(const char* wifi_ssid, const char* wifi_password, int local_port /*= DEFAULT_UDP_PORT*/, const char* local_host /*=nullptr*/) {
+bool UDPInterface::start(const char* wifi_ssid, const char* wifi_password, int port /*= DEFAULT_UDP_PORT*/, const char* local_host /*=nullptr*/) {
online(false);
if (wifi_ssid != nullptr) {
@@ -55,6 +55,8 @@ bool UDPInterface::start(const char* wifi_ssid, const char* wifi_password, int l
if (local_host != nullptr) {
_local_host = local_host;
}
+ _local_port = port;
+ _remote_port = port;
extreme("UDPInterface: wifi ssid: " + _wifi_ssid);
extreme("UDPInterface: wifi password: " + _wifi_password);
extreme("UDPInterface: local host: " + _local_host);
diff --git a/src/Interfaces/UDPInterface.h b/src/Interfaces/UDPInterface.h
index 7d71f7a..243dd34 100644
--- a/src/Interfaces/UDPInterface.h
+++ b/src/Interfaces/UDPInterface.h
@@ -33,7 +33,7 @@ namespace RNS { namespace Interfaces {
UDPInterface(const char* name = "UDPInterface");
virtual ~UDPInterface();
- bool start(const char* wifi_ssid, const char* wifi_password, int local_port = DEFAULT_UDP_PORT, const char* local_host = nullptr);
+ bool start(const char* wifi_ssid, const char* wifi_password, int port = DEFAULT_UDP_PORT, const char* local_host = nullptr);
void stop();
void loop();
@@ -57,7 +57,7 @@ namespace RNS { namespace Interfaces {
// broadcast
std::string _local_host = DEFAULT_UDP_LOCAL_HOST;
int _local_port = DEFAULT_UDP_PORT;
- std::string _remote_host = DEFAULT_UDP_LOCAL_HOST;
+ std::string _remote_host = DEFAULT_UDP_REMOTE_HOST;
int _remote_port = DEFAULT_UDP_PORT;
// create UDP instance
Served by rngit 1.5.0 - Generated in 0.04s